home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / sgesvx.z / sgesvx
Encoding:
Text File  |  2002-10-03  |  13.6 KB  |  331 lines

  1.  
  2.  
  3.  
  4. SSSSGGGGEEEESSSSVVVVXXXX((((3333SSSS))))                                                          SSSSGGGGEEEESSSSVVVVXXXX((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      SGESVX - use the LU factorization to compute the solution to a real
  10.      system of linear equations A * X = B,
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      SUBROUTINE SGESVX( FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, EQUED,
  14.                         R, C, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, IWORK,
  15.                         INFO )
  16.  
  17.          CHARACTER      EQUED, FACT, TRANS
  18.  
  19.          INTEGER        INFO, LDA, LDAF, LDB, LDX, N, NRHS
  20.  
  21.          REAL           RCOND
  22.  
  23.          INTEGER        IPIV( * ), IWORK( * )
  24.  
  25.          REAL           A( LDA, * ), AF( LDAF, * ), B( LDB, * ), BERR( * ), C(
  26.                         * ), FERR( * ), R( * ), WORK( * ), X( LDX, * )
  27.  
  28. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  29.      These routines are part of the SCSL Scientific Library and can be loaded
  30.      using either the -lscs or the -lscs_mp option.  The -lscs_mp option
  31.      directs the linker to use the multi-processor version of the library.
  32.  
  33.      When linking to SCSL with -lscs or -lscs_mp, the default integer size is
  34.      4 bytes (32 bits). Another version of SCSL is available in which integers
  35.      are 8 bytes (64 bits).  This version allows the user access to larger
  36.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  37.      by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use
  38.      only one of the two versions; 4-byte integer and 8-byte integer library
  39.      calls cannot be mixed.
  40.  
  41. PPPPUUUURRRRPPPPOOOOSSSSEEEE
  42.      SGESVX uses the LU factorization to compute the solution to a real system
  43.      of linear equations A * X = B, where A is an N-by-N matrix and X and B
  44.      are N-by-NRHS matrices.
  45.  
  46.      Error bounds on the solution and a condition estimate are also provided.
  47.  
  48.  
  49. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  50.      The following steps are performed:
  51.  
  52.      1. If FACT = 'E', real scaling factors are computed to equilibrate
  53.         the system:
  54.            TRANS = 'N':  diag(R)*A*diag(C)     *inv(diag(C))*X = diag(R)*B
  55.            TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B
  56.            TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B
  57.         Whether or not the system will be equilibrated depends on the
  58.         scaling of the matrix A, but if equilibration is used, A is
  59.         overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N')
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSGGGGEEEESSSSVVVVXXXX((((3333SSSS))))                                                          SSSSGGGGEEEESSSSVVVVXXXX((((3333SSSS))))
  71.  
  72.  
  73.  
  74.         or diag(C)*B (if TRANS = 'T' or 'C').
  75.  
  76.      2. If FACT = 'N' or 'E', the LU decomposition is used to factor the
  77.         matrix A (after equilibration if FACT = 'E') as
  78.            A = P * L * U,
  79.         where P is a permutation matrix, L is a unit lower triangular
  80.         matrix, and U is upper triangular.
  81.  
  82.      3. If some U(i,i)=0, so that U is exactly singular, then the routine
  83.         returns with INFO = i. Otherwise, the factored form of A is used
  84.         to estimate the condition number of the matrix A.  If the
  85.         reciprocal of the condition number is less than machine precision,
  86.         INFO = N+1 is returned as a warning, but the routine still goes on
  87.         to solve for X and compute error bounds as described below.
  88.  
  89.      4. The system of equations is solved for X using the factored form
  90.         of A.
  91.  
  92.      5. Iterative refinement is applied to improve the computed solution
  93.         matrix and calculate error bounds and backward error estimates
  94.         for it.
  95.  
  96.      6. If equilibration was used, the matrix X is premultiplied by
  97.         diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so
  98.         that it solves the original system before equilibration.
  99.  
  100.  
  101. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  102.      FACT    (input) CHARACTER*1
  103.              Specifies whether or not the factored form of the matrix A is
  104.              supplied on entry, and if not, whether the matrix A should be
  105.              equilibrated before it is factored.  = 'F':  On entry, AF and
  106.              IPIV contain the factored form of A.  If EQUED is not 'N', the
  107.              matrix A has been equilibrated with scaling factors given by R
  108.              and C.  A, AF, and IPIV are not modified.  = 'N':  The matrix A
  109.              will be copied to AF and factored.
  110.              = 'E':  The matrix A will be equilibrated if necessary, then
  111.              copied to AF and factored.
  112.  
  113.      TRANS   (input) CHARACTER*1
  114.              Specifies the form of the system of equations:
  115.              = 'N':  A * X = B     (No transpose)
  116.              = 'T':  A**T * X = B  (Transpose)
  117.              = 'C':  A**H * X = B  (Transpose)
  118.  
  119.      N       (input) INTEGER
  120.              The number of linear equations, i.e., the order of the matrix A.
  121.              N >= 0.
  122.  
  123.      NRHS    (input) INTEGER
  124.              The number of right hand sides, i.e., the number of columns of
  125.              the matrices B and X.  NRHS >= 0.
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SSSSGGGGEEEESSSSVVVVXXXX((((3333SSSS))))                                                          SSSSGGGGEEEESSSSVVVVXXXX((((3333SSSS))))
  137.  
  138.  
  139.  
  140.      A       (input/output) REAL array, dimension (LDA,N)
  141.              On entry, the N-by-N matrix A.  If FACT = 'F' and EQUED is not
  142.              'N', then A must have been equilibrated by the scaling factors in
  143.              R and/or C.  A is not modified if FACT = 'F' or
  144.  
  145.              On exit, if EQUED .ne. 'N', A is scaled as follows:  EQUED = 'R':
  146.              A := diag(R) * A
  147.              EQUED = 'C':  A := A * diag(C)
  148.              EQUED = 'B':  A := diag(R) * A * diag(C).
  149.  
  150.      LDA     (input) INTEGER
  151.              The leading dimension of the array A.  LDA >= max(1,N).
  152.  
  153.      AF      (input or output) REAL array, dimension (LDAF,N)
  154.              If FACT = 'F', then AF is an input argument and on entry contains
  155.              the factors L and U from the factorization A = P*L*U as computed
  156.              by SGETRF.  If EQUED .ne. 'N', then AF is the factored form of
  157.              the equilibrated matrix A.
  158.  
  159.              If FACT = 'N', then AF is an output argument and on exit returns
  160.              the factors L and U from the factorization A = P*L*U of the
  161.              original matrix A.
  162.  
  163.              If FACT = 'E', then AF is an output argument and on exit returns
  164.              the factors L and U from the factorization A = P*L*U of the
  165.              equilibrated matrix A (see the description of A for the form of
  166.              the equilibrated matrix).
  167.  
  168.      LDAF    (input) INTEGER
  169.              The leading dimension of the array AF.  LDAF >= max(1,N).
  170.  
  171.      IPIV    (input or output) INTEGER array, dimension (N)
  172.              If FACT = 'F', then IPIV is an input argument and on entry
  173.              contains the pivot indices from the factorization A = P*L*U as
  174.              computed by SGETRF; row i of the matrix was interchanged with row
  175.              IPIV(i).
  176.  
  177.              If FACT = 'N', then IPIV is an output argument and on exit
  178.              contains the pivot indices from the factorization A = P*L*U of
  179.              the original matrix A.
  180.  
  181.              If FACT = 'E', then IPIV is an output argument and on exit
  182.              contains the pivot indices from the factorization A = P*L*U of
  183.              the equilibrated matrix A.
  184.  
  185.      EQUED   (input or output) CHARACTER*1
  186.              Specifies the form of equilibration that was done.  = 'N':  No
  187.              equilibration (always true if FACT = 'N').
  188.              = 'R':  Row equilibration, i.e., A has been premultiplied by
  189.              diag(R).  = 'C':  Column equilibration, i.e., A has been
  190.              postmultiplied by diag(C).  = 'B':  Both row and column
  191.              equilibration, i.e., A has been replaced by diag(R) * A *
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. SSSSGGGGEEEESSSSVVVVXXXX((((3333SSSS))))                                                          SSSSGGGGEEEESSSSVVVVXXXX((((3333SSSS))))
  203.  
  204.  
  205.  
  206.              diag(C).  EQUED is an input argument if FACT = 'F'; otherwise, it
  207.              is an output argument.
  208.  
  209.      R       (input or output) REAL array, dimension (N)
  210.              The row scale factors for A.  If EQUED = 'R' or 'B', A is
  211.              multiplied on the left by diag(R); if EQUED = 'N' or 'C', R is
  212.              not accessed.  R is an input argument if FACT = 'F'; otherwise, R
  213.              is an output argument.  If FACT = 'F' and EQUED = 'R' or 'B',
  214.              each element of R must be positive.
  215.  
  216.      C       (input or output) REAL array, dimension (N)
  217.              The column scale factors for A.  If EQUED = 'C' or 'B', A is
  218.              multiplied on the right by diag(C); if EQUED = 'N' or 'R', C is
  219.              not accessed.  C is an input argument if FACT = 'F'; otherwise, C
  220.              is an output argument.  If FACT = 'F' and EQUED = 'C' or 'B',
  221.              each element of C must be positive.
  222.  
  223.      B       (input/output) REAL array, dimension (LDB,NRHS)
  224.              On entry, the N-by-NRHS right hand side matrix B.  On exit, if
  225.              EQUED = 'N', B is not modified; if TRANS = 'N' and EQUED = 'R' or
  226.              'B', B is overwritten by diag(R)*B; if TRANS = 'T' or 'C' and
  227.              EQUED = 'C' or 'B', B is overwritten by diag(C)*B.
  228.  
  229.      LDB     (input) INTEGER
  230.              The leading dimension of the array B.  LDB >= max(1,N).
  231.  
  232.      X       (output) REAL array, dimension (LDX,NRHS)
  233.              If INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X to the
  234.              original system of equations.  Note that A and B are modified on
  235.              exit if EQUED .ne. 'N', and the solution to the equilibrated
  236.              system is inv(diag(C))*X if TRANS = 'N' and EQUED = 'C' or 'B',
  237.              or inv(diag(R))*X if TRANS = 'T' or 'C' and EQUED = 'R' or 'B'.
  238.  
  239.      LDX     (input) INTEGER
  240.              The leading dimension of the array X.  LDX >= max(1,N).
  241.  
  242.      RCOND   (output) REAL
  243.              The estimate of the reciprocal condition number of the matrix A
  244.              after equilibration (if done).  If RCOND is less than the machine
  245.              precision (in particular, if RCOND = 0), the matrix is singular
  246.              to working precision.  This condition is indicated by a return
  247.              code of INFO > 0.
  248.  
  249.      FERR    (output) REAL array, dimension (NRHS)
  250.              The estimated forward error bound for each solution vector X(j)
  251.              (the j-th column of the solution matrix X).  If XTRUE is the true
  252.              solution corresponding to X(j), FERR(j) is an estimated upper
  253.              bound for the magnitude of the largest element in (X(j) - XTRUE)
  254.              divided by the magnitude of the largest element in X(j).  The
  255.              estimate is as reliable as the estimate for RCOND, and is almost
  256.              always a slight overestimate of the true error.
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. SSSSGGGGEEEESSSSVVVVXXXX((((3333SSSS))))                                                          SSSSGGGGEEEESSSSVVVVXXXX((((3333SSSS))))
  269.  
  270.  
  271.  
  272.      BERR    (output) REAL array, dimension (NRHS)
  273.              The componentwise relative backward error of each solution vector
  274.              X(j) (i.e., the smallest relative change in any element of A or B
  275.              that makes X(j) an exact solution).
  276.  
  277.      WORK    (workspace/output) REAL array, dimension (4*N)
  278.              On exit, WORK(1) contains the reciprocal pivot growth factor
  279.              norm(A)/norm(U). The "max absolute element" norm is used. If
  280.              WORK(1) is much less than 1, then the stability of the LU
  281.              factorization of the (equilibrated) matrix A could be poor. This
  282.              also means that the solution X, condition estimator RCOND, and
  283.              forward error bound FERR could be unreliable. If factorization
  284.              fails with 0<INFO<=N, then WORK(1) contains the reciprocal pivot
  285.              growth factor for the leading INFO columns of A.
  286.  
  287.      IWORK   (workspace) INTEGER array, dimension (N)
  288.  
  289.      INFO    (output) INTEGER
  290.              = 0:  successful exit
  291.              < 0:  if INFO = -i, the i-th argument had an illegal value
  292.              > 0:  if INFO = i, and i is
  293.              <= N:  U(i,i) is exactly zero.  The factorization has been
  294.              completed, but the factor U is exactly singular, so the solution
  295.              and error bounds could not be computed. RCOND = 0 is returned.  =
  296.              N+1: U is nonsingular, but RCOND is less than machine precision,
  297.              meaning that the matrix is singular to working precision.
  298.              Nevertheless, the solution and error bounds are computed because
  299.              there are a number of situations where the computed solution can
  300.              be more accurate than the value of RCOND would suggest.
  301.  
  302. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  303.      INTRO_LAPACK(3S), INTRO_SCSL(3S)
  304.  
  305.      This man page is available only online.
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.